<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery" >
        <a-row :gutter="24">
          <a-card title="组织架构">
            <a-card-grid style="width:50%;text-align:center">
              <input type="checkbox"    v-model="queryParam.org1"  v-bind:true-value="1000015019"  v-bind::false-value="1" /> 平高电器
            </a-card-grid>
            <a-card-grid style="width:50%;text-align:center" :hoverable="false">
              <input type="checkbox"    v-model="queryParam.org2"   v-bind:true-value="1000014563"  v-bind::false-value="1" />平芝
            </a-card-grid>
            <a-card-grid style="width:25%;text-align:center">
              <input type="checkbox"    v-model="queryParam.orgName1"   v-bind:true-value="40001"  v-bind::false-value="1"/>组合电器
            </a-card-grid>
            <a-card-grid style="width:25%;text-align:center">
              <input type="checkbox"    v-model="queryParam.orgName2"   v-bind:true-value="40002"  v-bind::false-value="1"/>断路器
              {{queryParam.orgName}}
            </a-card-grid>
          </a-card>
        </a-row>
        <a-row v-if="show" style="padding-top: 30px">
          <a-col :md="6" :sm="8">
            <a-form-item label="供应商工单编号">
              <a-input placeholder="供应商工单编号" v-model="queryParam.supplierWorkNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" style="padding-left: 10px">
            <a-form-item label="产品厂内编号">
              <a-input placeholder="产品厂内编号" v-model="queryParam.productModel"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" style="padding-left: 10px">
            <a-form-item label="生产设备名称">
              <a-input placeholder="生产设备名称" v-model="queryParam.equipmentName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" style="padding-left: 10px">
            <a-form-item label="开始采集时间">
              <a-input placeholder="开始采集时间" v-model="queryParam.startCheckTime"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" style="padding-left: 10px">
            <a-form-item label="结束采集时间">
              <a-input placeholder="结束采集时间" v-model="queryParam.endCheckTime"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" style="padding-left: 10px">
            <a-form-item label="工序">
              <a-input placeholder="工序" v-model="queryParam.pdCode"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <!--<a-row :gutter="24">-->
        <!--<a-card>-->
        <!--<a-card title="平高" :bordered="false">-->
        <!--<a-col :span="12">-->
        <!--<a-card title="组合电器">-->
        <!--</a-card>-->
        <!--</a-col>-->
        <!--<a-col :span="12">-->
        <!--<a-card title="断路器">-->
        <!--</a-card>-->
        <!--</a-col>-->
        <!--</a-card>-->
        <!--</a-card>-->
        <!--<a-card>-->
        <!--<a-card title="平芝" :bordered="false" >-->
        <!--</a-card>-->
        <!--</a-card>-->
        <!--</a-row>-->
        <!--<a-row>-->
        <!--<a-col >-->
        <!--<a-form-item label="销售订单号">-->
        <!--<a-input placeholder="销售订单号" v-model="queryParam.soNo"></a-input>-->
        <!--</a-form-item>-->
        <!--</a-col>-->
        <!--</a-row>-->
        <a-row :gutter="24" style="padding-top: 30px">
          <a-col :md="5" :sm="5">
            <!-- 操作按钮区域 -->
            <span class="table-operator">
              <!--<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
              <a-button type="primary" icon="download" @click="handleExportXls('eip_work_order')">导出</a-button>
              <!--<a-button  type="primary" icon="plus">校验</a-button>-->
              <!--<a-button  type="primary" icon="plus">审核</a-button>-->
              <!--<a-dropdown v-if="selectedRowKeys.length > 0">-->
              <!--<a-menu slot="overlay">-->
              <!--<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
              <!--</a-menu>-->
              <!--<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
              <!--</a-dropdown>-->
            </span>
          </a-col>
          <a-col :md="5" :sm="5">
            <a-form-item label="工单号">
              <a-input placeholder="工单号" v-model="queryParam.supplierWorkNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="5">
            <j-date v-model="queryParam.dataSourceCreateTime" :showTime="true" date-format="YYYY-MM-DD" style="width:45%" placeholder="请选择日期" ></j-date>
          </a-col>
          <a-col :md="5" :sm="5" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            </span>
          </a-col>
          <a-col :md="4" :sm="4">
            <a-button type="primary" @click="showOrClose" icon="search" >高级查询</a-button>
          </a-col>
        </a-row>
      </a-form>

    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <!--<div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('zpg_eip_dlq_nzjsd')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>-->

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="puid"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="uploadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>

    <zpgEipDlqNzjsd-modal ref="modalForm" @ok="modalFormOk"></zpgEipDlqNzjsd-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZpgEipDlqNzjsdModal from './modules/ZpgEipDlqNzjsdModal'
  export default {
    name: "ZpgEipDlqNzjsdList",
    mixins:[JeecgListMixin],
    components: {
      ZpgEipDlqNzjsdModal
    },
    data () {
      return {
        description: 'zpg_eip_dlq_nzjsd管理页面',
        show:false,
        orgName1:"",
        orgName2:"",
        org1:"",
        org2:"",
        // 表头
        columns: [
          {
            title:'物资品类类型',
            align:"center",
            dataIndex: 'categoryType'
          },
          {
            title:'供应商工单编号',
            align:"center",
            dataIndex: 'supplierWorkNo'
          },
          {
            title:'国网侧供应商编码',
            align:"center",
            dataIndex: 'supplierCode'
          },
          {
            title:'供应商产品厂内编号',
            align:"center",
            dataIndex: 'productModel'
          },
          {
            title:'生产设备名称',
            align:"center",
            dataIndex: 'equipmentName'
          },
          {
            title:'湿度',
            align:"center",
            dataIndex: 'humidity'
          },
          {
            title:'采集时间',
            align:"center",
            dataIndex: 'checkTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'工序',
            align:"center",
            dataIndex: 'pdCode'
          },

          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/zpgEipDlqNzjsd/selectForList",
          delete: "/zpgEipDlqNzjsd/delete",
          // deleteBatch: "/pg/zpgEipDlqNzjsd/deleteBatch",
          exportXlsUrl: "/zpgEipDlqNzjsd/exportXls",
          // importExcelUrl: "pg/zpgEipDlqNzjsd/importExcel",
        },
        dictOptions:{
        } 
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      showOrClose(){
        this.show = !this.show;
      },
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>